package com.jinkaimen.goodcash.ui.activity;


import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.ht.baselibs.core.EventCenter;
import com.ht.baselibs.core.EventCode;
import com.ht.baselibs.ui.base.BaseActivity;

import com.ht.baselibs.utils.ActivityUtils;
import com.jinkaimen.goodcash.R;

import de.greenrobot.event.EventBus;

public class WriteBankActivity extends BaseActivity {
    private TextView btn_activity_electronic_documents;
    private EditText et_clear_button;


    @Override
    protected boolean isStaticPage() {
        return true;
    }

    @Override
    protected void initTitleBar() {
        mTitleBarView.setTitleText("搜索支行");
    }

    @Override
    protected int initContentView() {
        return R.layout.activity_write_bank;
    }

    @Override
    protected void initChildView() {
        btn_activity_electronic_documents = (TextView) findViewById(R.id.btn_activity_electronic_documents);
        et_clear_button = (EditText) findViewById(R.id.et_clear_button);
    }

    @Override
    protected void initChildData() {

    }

    @Override
    protected void setChildViewListener() {
        btn_activity_electronic_documents.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.btn_activity_electronic_documents:
                String name = et_clear_button.getText().toString().trim();
                if (TextUtils.isEmpty(name)) {
                    return;
                } else {
                    Intent i = new Intent();
                    i.putExtra("bankName", name);
                    i.putExtra("branchCode", -1);
                    EventBus.getDefault().post(new EventCenter(EventCode.EVENT_CODE_BANKNAME, i));
                    ActivityUtils.finishActivity(WriteBankActivity.this);
                }
                break;
        }
    }
}
